﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>登录</title>

<link href="css/index.css" rel="stylesheet" type="text/css" />
<link href="css/register.css" rel="stylesheet" type="text/css" />

</head>
  
<body>
	<%@ include file="public/head.jsp" %>
		<div id="hr-body">
			<div class="hr-body-content">
				
				<table class="hr-body-layout" width="100%">
					<tbody>
						<tr>
							<%@include file="public/left.jsp" %>
							<td class="hr-bl-right" valign="top">
								  <div class="LoginWrap" style="padding:30px 100px;width:400px; text-align:left;">
									<form name="FORM_LOGIN" action="loginuser" method="post" onsubmit="return Form_Validator(this)" target="_parent">
									  <input type="hidden" name="gOo" value="login_act.do" />
									  <h2>要完成购物请先登录，如没有注册请先注册！</h2>
									  <br />
									  <%
									  	if(request.getAttribute("err") != null){
									  	String err = (String)request.getAttribute("err");
									  	String err1 = "验证码错误"; 
									  	if(err1.equals(err)){
									  		out.print("<script type='text/javascript'>alert('验证码错误！');</script>");
									  	}
									  	}
									   %>
									  <label>用户名：</label>
									  <input class="inputstyle" size="20" name="username" />
									  <br />
									  <label>密码：</label>
									  <input class="inputstyle" type="password" size="20" value="" name="passwd" />
									  <br />
									  
									  <label>验证码：</label>
									  <input class="inputstyle" size="8" value="" name="verifycode" />
									  <img src="image.jsp" align="absmiddle" />
									  <br />
									  
									  <label>&nbsp;</label>
									  <input name="Submit" type="submit"  value="立即登录" class="buttonstyle" />
									  <a href="reg"> 用户注册</a>
									</form>
									</div>
									<script type="text/javascript">  
								
									function  Form_Validator(frm)   
									{
									    if(frm.username.value=="")
									    {
											alert("请输入用户名");
											return false;
									    }
									    if(frm.passwd.value=="")
									    {
											alert("请输入密码");
											return false;
									    }
									    if(frm.verifycode){
										   
										    if(frm.verifycode.value=="")
										    {
												alert("请输入验证码");
												return false;
										    }
									   
									    }
									    
									}
									</script>
							</td>
						</tr>
				</tbody>
			</table>
			<%@ include file="public/bottom.jsp" %>
		</div>
	</div>
	<%@ include file="public/foot.jsp" %>
</body>
</html>
